
INSTALL_SCRIPT=.make_install_tmp

default: all

all: oo_extension oo_client


oo_extension: 
	make -C extension

oo_client:
	regmerge client/fann_plugin.rdb / $(OO_SDK_HOME)../program/types.rdb
	regmerge client/fann_plugin.rdb / $(OO_SDK_HOME)../program/services.rdb
	cppumaker -BUCR -O./client client/fann_plugin.rdb
	qmake client/fann_plugin.pro -o client/Makefile
	make -C client
	rm $(INSTALL_SCRIPT) -rf
	echo "mkdir $(OFFICE_HOME)fann -p" >> $(INSTALL_SCRIPT)
	echo "cp client/fann_plugin.rdb $(OFFICE_HOME)fann/" >> $(INSTALL_SCRIPT)
	echo "cp client/fann_logo.png $(OFFICE_HOME)fann/" >> $(INSTALL_SCRIPT)
	echo "cp client/fann_plugin $(OFFICE_HOME)fann/" >> $(INSTALL_SCRIPT)
	

clean:
	#make -C extension clean
	make -C client clean
	rm $(OFFICE_HOME)fann/fann_plugin.rdb -rf
	rm $(OFFICE_HOME)fann/fann_logo.png -rf
	rm $(OFFICE_HOME)fann/fann_plugin -rf
	rm $(INSTALL_SCRIPT) -rf

install:
	bash $(INSTALL_SCRIPT)
